package net.wang.boot.order.web;

import net.wang.gmall.service.IOrderService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;

@RestController
@RequestMapping(value = "/api/order")
public class OrderController {

    @Resource
    IOrderService orderService;

    @GetMapping(value = "/init")
    public ResponseEntity<Object> initOrder(@RequestParam final String uuid) throws IOException {
        return ResponseEntity.ok(orderService.initOrder(uuid));
    }
}